<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <base href="<%=basePath%>">
    
     <!-- 给当前页面域添加一段java代码，用来自动获取当前项目名，不写死,然后再通过EL表达式获取 -->
    <%
    	pageContext.setAttribute("PATH",request.getContextPath());
    
     %>
    
    
  
  <!-- 搭建主页面显示 -->
  <div>
  
  	<!-- 标题行 -->
   <h3><span class="label label-info ">德林文化传媒有限公司</span></h3>
    	
    	<!-- 图片展示列表 -->
     <table class="table table-striped table table-hover">
       <tr>
	       <th>ID</th>
	       <th>用户号码</th>
	       <th>注册日期</th>
	       <th>操作</th>
       </tr>
        <c:forEach items="${users}" var="list">
            <tr>
           	 	<td>${list.id}</td>
   				<td>${list.phone }</td>
   				<td><fmt:formatDate type="both" value="${list.createDate }" /></td>
           	 	
           	 	<td>
           	 		<div class="row">
			    		<div class="col-md-6 col-md-offset-0">
			    			<button type="button" class="btn btn-danger" onclick="deleteUser(${list.id})">
			    				<span class="glyphicon glyphicon-trash"></span>
			    					删除
			    			</button>
	    				</div>
    				</div>
           	 	</td>
           	 </tr>
        </c:forEach>
        
     </table>
    		
    </div>		

    <script>
  
		
		//删除图片
		function deleteUser(id){
			if(confirm("确认删除id为"+id+"吗？")){
				location.href="${PATH}/deleteUser.go?id="+id;
				alert("删除成功！")
			}
		}
		
	</script>
    